package com.sukaiyi.giteeideaplugin.mainwindow;

import cn.hutool.json.JSONObject;
import com.intellij.openapi.ui.DialogWrapper;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import javax.swing.*;

public class RepoDetailWindowDialogWrapper extends DialogWrapper {

    private final JSONObject repo;

    public RepoDetailWindowDialogWrapper(JSONObject repo) {
        super(true);
        this.repo = repo;
        setTitle(repo.getStr("name"));
        init();
        setModal(false);
    }

    @Nullable
    @Override
    protected JComponent createCenterPanel() {
        RepoDetailWindow window = new RepoDetailWindow(repo);
        return window.getContent();
    }

    @Nullable
    @Override
    protected String getDimensionServiceKey() {
        return this.getClass().getName();
    }

    @NotNull
    @Override
    protected Action[] createActions() {
        return new Action[0];
    }
}
